import Relay from "react-relay";

export default class FindTemplateByIdMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { findTemplateById }`;
    }

    getVariables() {
        return {
            argsInput: {
                templateId:this.props.templateId,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on findTemplateByIdPayload {
            findTemplateById {
                errorCode
                value
                totalResult
                id
                orderTemplate{
                   name
                   tid     
                    qualityAsk
                    packageAsk
                    logisticsAsk
                    payMode
                    dutyBreak
                    checkAsk
                    
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on findTemplateByIdPayload {
                    findTemplateById {
                        errorCode
                        value
                        totalResult
                        id
                        orderTemplate{
                           name
                           tid
                           qualityAsk
                            packageAsk
                            logisticsAsk
                            payMode
                            dutyBreak
                            checkAsk
                           
                           
                        }
                    }
                }
            `]
        }];
    }

}
